#include "study_widget_middle.h"
#include "stydatabase.h"

study_widget_middle::study_widget_middle(QWidget *parent) : QWidget(parent)
{
    this->setObjectName("study_widget_middle");

    hlayout = new QHBoxLayout;
    vlayout = new QVBoxLayout;
    m_clock = new simple_clock(this);

    learnGoal = new QLabel("学习目标："+g_data[0].friends.ULearnGoals);
    learnDcla = new QLabel("学习宣言："+g_data[0].friends.ULearnDcla);
    UTgDay = new QLabel("计划完成时间："+QString::number(g_data[0].friends.UTgDay)+"天");
    UTgDayTime = new QLabel("每日计划学习时长："+QString("%1").arg(g_data[0].friends.UTgDayTime)+"小时");

    learnGoal->setObjectName("learnGoal");
    learnDcla->setObjectName("learnDcla");
    UTgDayTime->setObjectName("UTgDayTime");
    UTgDay->setObjectName("UTgDay");

    vlayout->addStretch(7);
    vlayout->addWidget(learnGoal);
    vlayout->addWidget(learnDcla);
    vlayout->addSpacing(10);
    vlayout->addWidget(UTgDayTime);
    vlayout->addWidget(UTgDay);
    vlayout->addStretch(3);
    hlayout->addWidget(m_clock);
    hlayout->addLayout(vlayout);
    //hlayout->addWidget(vlayout);

    this->setLayout(hlayout);
}

